package cn.itcast.com.exception;

public class demothrow {
    public static void main(String[] args) throws Exception {
        test(-1);
    }
    public static void test(int arg) throws Exception {
        if (arg<0) {
            String message = "参数非法！arg = "+arg;
            //IllegalArgumentException i = new IllegalArgumentException(message);
            Exception i = new Exception(message);
            throw i;
        }
    }
}
